
module.exports = function (path) {
  return {
    "appenders": {
      "dateFile": {
        "type": "dateFile",
        "filename": path + "/logs/majiang/access.log",
        "maxLogSize": 10 * 1024 * 1024, // = 10Mb
        "compress": false,
        "pattern": "-yyyy-MM-dd",
        "category": "http"
      },
      "debugFile": {
        "type": "file",
        "filename": path + "/logs/majiang/app.log",
        "maxLogSize": 10 * 1024 * 1024, // = 10Mb
        "compress": false,
        "pattern": "-yyyy-MM-dd",
        "layout": {
          "type": 'pattern',
          "pattern": '[%d] [%p] [%c] - %m'
        }
      },
      "debug": {
        "type": "logLevelFilter",
        "level": "TRACE",
        "maxLevel": 'WARN',
        "appender": "debugFile"
      },
      "errorFile": {
        "type": 'file',
        "filename": path + "/logs/majiang/errors.log",
        "maxLogSize": 10 * 1024 * 1024, // = 10Mb
        "compress": false,
        "pattern": "-yyyy-MM-dd",
        "layout": {
          "type": 'pattern',
          "pattern": '[%d] [%p] [%c] - %m'
        }
      },
      "error": {
        "type": "logLevelFilter",
        "level": "ERROR",
        "appender": "errorFile"
      },
      "out": {
        "type": "stdout"
      },
      "logstash": {
        "host": '192.168.0.135',
        "port": 7000,
        "type": 'logstashUDP',
        "logType": 'majiangType', // Optional, defaults to 'category'
        "layout": {
          "type": 'pattern',
          "pattern": '%m'
        }
      }
    },
    "categories": {
      "httpAccess": { "appenders": ["out", "logstash", "dateFile"], level: "info" },
      "default": {
        "appenders": [
          "debug",
          "error",
          'out',
        ],
        "level": "trace"
      },

    }
  }
}
